home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 14283 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: info.evansville.net!usenet
  2. From: gilligan@evansville.net (gilligan)
  3. Newsgroups: comp.lang.c
  4. Subject: A quick newbie question...hopefully...HELP!
  5. Date: Sat, 13 Apr 1996 03:58:36 GMT
  6. Organization: Evansville Online
  7. Message-ID: <4kn8gk$6t1@info.evansville.net>
  8. NNTP-Posting-Host: pm02-s2-tier2.evansville.net
  9. X-Newsreader: Forte Free Agent 1.0.82
  10.  
  11. Hi!
  12.     I am just starting at C, and have a question...one of my problems is I
  13. have to create a type of "Word Processor" where, regardless of number
  14. of carriage returns or spaces, I have to cram as many words as
  15. possible onto one line, be it 65 spaces or 40 (whatever the number),
  16. but there must be one space in between each word, and the line cannot
  17. end in the middle of the word.  The user is done when he/she hits
  18. CONTROL-Z, and then everything that he/she has typed is reformatted to
  19. as many lines as needed.  So, in other words, in this program, one
  20. could type:
  21. *****************************************************************************************
  22. THE DOG WENT
  23. TO THE VET'S PLACE AND                 THEN REALIZED THAT
  24. HE
  25. WAS GETTING
  26. A                     SHOT IN THE BUTT.
  27. *****************************************************************************
  28. And then when they hit Control-Z, it should read like this:
  29. THE DOG WENT TO THE VET'S PLACE AND THEN REALIZED THAT HE WAS GETTING
  30. A SHOT IN THE BUTT.
  31. So you see how it is like a word processor, kind of.  Now, my thoughts
  32. were either to use GETCHAR, or just get a string at a time, but I am a
  33. bit confused on this latter part...any ideas would be GREATLY
  34. appreciated...due to the fact that I don't get back here much, please
  35. send all questions/comments/suggestions to:
  36. gilligan@evansville.net
  37.  
  38. And MANY thanks in return!!
  39. Gilligan
  40.  
  41.  
  42.